home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-01-15 | 1.5 KB | 98 lines | [TEXT/CWIE] |
-
- // System includes
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __LISTS__
- #include <Lists.h>
- #endif
-
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
-
-
- // Application includes
-
- #ifndef __BAREBONES__
- #include "BareBones.h"
- #endif
-
-
- #ifndef USE_LDEF
-
-
- pascal void tabsLDEF ( short theMessage, short selFlags, Rect* theRect, Cell theCell,
- short theOffset, short theLen, ListRef theHandle );
-
-
-
-
-
- #if GENERATINGPOWERPC
- #pragma options align=mac68k
- #endif
-
-
- #if GENERATINGCFM
- typedef struct
- {
- RoutineDescriptor routineDescriptor;
-
- } LDEFPatch, *LDEFPatchPtr, **LDEFPatchHndl;
- #else
- typedef struct
- {
- short jmpInst;
- ProcPtr patchAddr;
-
- } LDEFPatch, *LDEFPatchPtr, **LDEFPatchHndl;
- #endif
-
- #if GENERATINGPOWERPC
- #pragma options align=reset
- #endif
-
-
-
-
-
-
- OSErr PatchListLDEF ( ListRef theList );
-
-
- OSErr PatchListLDEF ( ListRef theList )
- {
- OSErr theErr;
- LDEFPatchHndl ldefHndl;
- LDEFPatchPtr ldefPatch;
- RoutineDescriptor initializedRD = BUILD_ROUTINE_DESCRIPTOR ( uppListDefProcInfo,
- tabsLDEF );
-
- ldefHndl = (LDEFPatchHndl) NewHandle ( sizeof ( LDEFPatch ) );
- theErr = MemError ( );
- if ( theErr )
- return theErr;
-
- HLock ( (Handle) ldefHndl );
- ldefPatch = *ldefHndl;
-
- #if GENERATINGCFM
- ldefPatch->routineDescriptor = initializedRD;
- #else
- ldefPatch->jmpInst = 0x4EF9; // a 68K JMP instruction
- ldefPatch->patchAddr = (ProcPtr) tabsLDEF; // where we want to jmp
- #endif
-
- HUnlock ( (Handle) ldefHndl );
- (*theList)->listDefProc = (Handle) ldefHndl;
-
- return noErr;
- }
-
-
- #endif
-
-